/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ejb.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author ADMIN
 */
@Entity
@Table(catalog = "EASYTICKETS", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "TicketBook.findAll", query = "SELECT t FROM TicketBook t"),
    @NamedQuery(name = "TicketBook.findById", query = "SELECT t FROM TicketBook t WHERE t.id = :id"),
    @NamedQuery(name = "TicketBook.findByTitle", query = "SELECT t FROM TicketBook t WHERE t.title = :title"),
    @NamedQuery(name = "TicketBook.findByTimeShow", query = "SELECT t FROM TicketBook t WHERE t.timeShow = :timeShow"),
    @NamedQuery(name = "TicketBook.findByStartDate", query = "SELECT t FROM TicketBook t WHERE t.startDate = :startDate"),
    @NamedQuery(name = "TicketBook.findByEndDate", query = "SELECT t FROM TicketBook t WHERE t.endDate = :endDate"),
    @NamedQuery(name = "TicketBook.findByCity", query = "SELECT t FROM TicketBook t WHERE t.city = :city"),
    @NamedQuery(name = "TicketBook.findByStatus", query = "SELECT t FROM TicketBook t WHERE t.status = :status")})
public class TicketBook implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(nullable = false)
    private Integer id;
    @Size(max = 50)
    @Column(length = 50)
    private String title;
    @Temporal(TemporalType.TIMESTAMP)
    private Date timeShow;
    @Temporal(TemporalType.TIMESTAMP)
    private Date startDate;
    @Temporal(TemporalType.TIMESTAMP)
    private Date endDate;
    @Size(max = 20)
    @Column(length = 20)
    private String city;
    private Boolean status;
    @JoinColumn(name = "PaymentId", referencedColumnName = "Id")
    @ManyToOne
    private Payment paymentId;
    @JoinColumn(name = "EventId", referencedColumnName = "EventId")
    @ManyToOne
    private Event eventId;
    @JoinColumn(name = "AccountId", referencedColumnName = "Id")
    @ManyToOne
    private Account accountId;

    public TicketBook() {
    }

    public TicketBook(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Date getTimeShow() {
        return timeShow;
    }

    public void setTimeShow(Date timeShow) {
        this.timeShow = timeShow;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    public Payment getPaymentId() {
        return paymentId;
    }

    public void setPaymentId(Payment paymentId) {
        this.paymentId = paymentId;
    }

    public Event getEventId() {
        return eventId;
    }

    public void setEventId(Event eventId) {
        this.eventId = eventId;
    }

    public Account getAccountId() {
        return accountId;
    }

    public void setAccountId(Account accountId) {
        this.accountId = accountId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TicketBook)) {
            return false;
        }
        TicketBook other = (TicketBook) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ejb.entity.TicketBook[ id=" + id + " ]";
    }
    
}
